import request from "@/utils/request"

export async function queryCommissionList(params: Commission.QueryListParams) {
  return request<Commission.Entity[]>('/app/manager/splitRule/list', {
    data: params,
  })
}

export async function queryCommissionApplyList(params: Commission.QueryApplyListParams) {
  return request<Commission.Apply[]>('/app/manager/split/apply/list', {
    data: params,
  })
}

export async function audit(params: Partial<Commission.Refund>) {
  return request<boolean>('/app/manager/station/deposit/apply/status', {
    data: params,
  })
}

export async function queryRefundRecordApplyList(params: Commission.QueryRefundRecordListParams) {
  return request<Commission.Refund[]>('/app/manager/split/deposit/list', {
    data: params,
  })
}

export async function saveCommission(params: Partial<Commission.Entity>) {
  return request<boolean>('/app/manager/splitRule/addOrUpdate', {
    data: params,
  })
}

export async function editCommissionStatus(params: Partial<Commission.Entity>) {
  return request<boolean>('/app/manager/station/splitRule/status', {
    data: params,
  })
}

export async function editCommissionApplyStatus(params: Partial<Commission.Apply>) {
  return request<boolean>('/app/manager/station/split/apply/status', {
    data: params,
  })
}

export async function voidCommissionApply(params: Partial<Commission.Apply>) {
  return request<boolean>('/app/manager/station/split/expire', {
    data: params,
  })
}

export async function queryCommissionApplyLog(params: Partial<Commission.Apply>) {
  return request<Commission.Apply[]>('/app/manager/split/change/list', {
    data: params,
  })
}
